import json
from collections import Counter

with open('jobs.json') as f:
    data = json.loads(f.read())

title = {}
total = 0
for pos in data:
    t = pos['title']
    try:
        n = int(pos['num'])
    except:
        n = 3
    title[t] = title.get(t, 0) + n
    total += n

most_title = Counter(title).most_common(10)
rest = total
for t in most_title:
    print('{name:"%s", value:%s},' % t)
    rest -= t[1]

print('{name:"其他", value:%d}' % rest)

#print(['%s' % i[0] for i in most_title])